home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 23
/
Amiga Format AFCD23 (Feb 1998, Issue 107).iso
/
-coverdisks-
/
subsdisk
/
subs.dms
/
subs
/
gui4cli.LZX
/
Gui4Cli
/
Dir
/
Dir.gc.alt
< prev
next >
Wrap
Text File
|
2003-12-15
|
7KB
|
312 lines
G4C
; This is an alternate dir.gc which uses a separate gui for
; the favourites directories.
; To use this dir.gc, instead of the normal one, just replace
; the dir.gc file in the main "Dir" directory with this file,
; i.e. rename dir.gc to something else and rename this file
; to dir.gc
WINBIG 150 11 220 229 Devices
WinType 11110001
varpath ''
nofontsense
xOnLoad
setvar fm_mode 1
setgad Dir.gc 2 HIDE ; hide the gadgets of the
setgad Dir.gc 10 HIDE ; other half of the window
setgad Dir.gc 11 HIDE
setgad Dir.gc 12 HIDE
setgad Dir.gc 13 HIDE
setgad Dir.gc 14 HIDE
setgad Dir.gc 15 HIDE
setgad Dir.gc 16 HIDE
setgad Dir.gc 17 HIDE
guiopen Dir.gc
guiload :Dir.g ; load the helper guis
guiload guis:tools/cli.gc ; the cli gui
guiload guis:tools/ViewFile.g ; auto view function
guiload guis:tools/Prefs/players ; the default viewers
guiload :dir.fav ; the favourites gui
xonquit
guiquit Dir.g ; quit our other guis also
guiquit ViewFile.g
guiquit Dir.g2
guiquit Dir.g3
guiquit dir.g4
guiquit cli.gc
guiquit dir.prot
guiquit dir.user
guiquit dir.fav
xOnOpen
SetGad dir.gc 20 OFF
xOnClose
SetGad dir.gc 20 ON
xAppIcon 0 0 :dir.gc DIR.gc *lv_app OFF
GadID 20
GuiOpen dir.gc
GuiScreen dir.gc FRONT
if $*lv_app > " "
gosub dir.gc appdir
endif
xAppWindow *lv_app ; The FM is also an AppWindow
gosub dir.gc appdir ; going to the dir of the icon..
xroutine appdir ; cd to the appitem's dir
ifexists DIR $*lv_app ; if it's a dir,vol,dev or asn
orifexists DOS $*lv_app
dir = $*lv_app
file = ''
elseifexists file $*lv_app ; if it's a file
extract *lv_app PATH dir
extract *lv_app FILE file
endif
lvuse dir.gc 1
lvdir #$dir
lvfind $file
setwintitle dir.gc '$dir '
delvar *lv_app
xOnRMB
guiopen Dir.g ; This has the copy, delete etc functions
;========================= The Directory ListViews ==================
; Note they both have Hooks to display the current dir to the user.
;---------> the left side
XLISTVIEW 0 0 204 228 "" lv_file "" 10 DIR
gadid 1
lvdirhook 1
GadFont topaz.font 8 000 ; CHANGE THIS TO THE FONT YOU LIKE!
;LVColors 2 1 3 2
guiopen Dir.g2
xLVDirHook 1
setwintitle Dir.gc '$$lv.dir ' ; show it in the wintitle
;----------> the right side
XLISTVIEW 220 16 205 212 "" lv_file "" 10 DIR
gadid 2
lvdirhook 2
GadFont topaz.font 8 000 ; CHANGE THIS TO THE FONT YOU LIKE!
guiopen Dir.g2
xLVDirHook 2
update Dir.gc 10 $$lv.dir ; show it in xTextIn gadget below
XTEXTIN 220 0 204 16 "" lvdir2 "" 140
gadid 10
GadFont topaz.font 8 000
lvuse dir.gc 2
LVDir #$lvdir2 ; you can change the dir from here
;======================== The Action buttons ==========================
;--------> for the left side (source)
XBUTTON 205 0 14 13 P
lvuse dir.gc 1
LVDir parent
lv_ir1 = $$LV_DIR
setwintitle Dir.gc '$$lv.dir '
XBUTTON 205 13 14 13 R
lvuse dir.gc 1
LVDir Root
lv_dir1 = $$LV_DIR
setwintitle Dir.gc '$$lv.dir '
XBUTTON 205 26 14 13 D
lvuse dir.gc 1
LVDir Disks
lv_dir1 = ""
setwintitle Dir.gc 'Devices'
XBUTTON 205 39 14 13 A
lvuse dir.gc 1
LVDir all
XBUTTON 205 52 14 13 N
lvuse dir.gc 1
LVDir None
XBUTTON 205 65 14 15 F
favid = 1
guiopen dir.fav
XBUTTON 205 177 14 12 + ; add to favourites
lvuse dir.gc 1
gosub dir.fav addfav
XBUTTON 205 189 14 13 R
lvuse dir.gc 1
lvdir Refresh
XBUTTON 205 202 14 13 < ; move list left
lvuse dir.gc 1
lvmove -10
XBUTTON 205 215 14 13 >
lvuse dir.gc 1
lvmove 10
;---------> for the right side (destination) give gadID so we set them on/off
XBUTTON 426 0 14 13 P
GadID 11
lvuse dir.gc 2
LVDir parent
setvar lv_dir2 $$LV.DIR
update Dir.gc 10 $$lv.dir
XBUTTON 426 13 14 13 R
gadid 12
lvuse dir.gc 2
LVDir Root
setvar lv_dir2 $$LV.DIR
update Dir.gc 10 $$lv.dir
XBUTTON 426 26 14 13 D
gadid 13
lvuse dir.gc 2
LVDir Disks
setvar lv_dir2 ""
update Dir.gc 10 ""
XBUTTON 426 39 14 13 A
gadid 14
lvuse dir.gc 2
LVDir All
XBUTTON 426 52 14 13 N
gadid 15
lvuse dir.gc 2
LVDir None
XBUTTON 426 65 14 15 F
gadid 151
favid = 2
guiopen dir.fav
XBUTTON 426 178 14 11 + ; add to favourites
lvuse dir.gc 2
gosub dir.fav addfav
XBUTTON 426 189 14 13 R
lvuse dir.gc 2
lvdir Refresh
XBUTTON 426 202 14 13 < ; move list left
GadID 16
lvuse dir.gc 2
lvmove -10
XBUTTON 426 215 14 13 > ; move list right
GadID 17
lvuse dir.gc 2
lvmove 10
;---------> open full file manager
XBUTTON 205 108 14 11 >
gadid 21
if $fm_mode = 1
gosub Dir.gc OpenWindow
else
gosub Dir.gc CloseWindow
endif
;--------> button to switch left <-> right lvs
XBUTTON 205 119 14 11 x
gadid 20
lvuse dir.gc 1
tempdir1 = $$lv.dir
lvuse dir.gc 2
tempdir2 = $$lv.dir
lvdir #$tempdir1
lvuse dir.gc 1
lvdir #$tempdir2
setwintitle Dir.gc '$tempdir2 ' ; and their dir displays
update Dir.gc 10 $tempdir1
delvar tempdir#?
;--------> same directories
XBUTTON 205 130 14 11 =
if $$lv.gui == dir.gc ; check that the internal vars point to us
id = $$lv.id
dir = $$lv.dir
if $id = 1
lvuse dir.gc 2
lvdir #$dir
update Dir.gc 10 $dir
else
lvuse dir.gc 1
lvdir #$dir
setwintitle Dir.gc '$dir '
endif
endif
;---------> open favourites gui
XBUTTON 205 65 14 15 F
favid = 1
guiopen dir.fav
;---------> ROUTINES
xRoutine OpenWindow ; Routine to enlarge the window
fm_mode = 2
setgad Dir.gc 2 SHOW
setgad Dir.gc 10 SHOW
setgad Dir.gc 11 SHOW
setgad Dir.gc 12 SHOW
setgad Dir.gc 13 SHOW
setgad Dir.gc 14 SHOW
setgad Dir.gc 15 SHOW
setgad Dir.gc 151 SHOW
setgad Dir.gc 16 SHOW
setgad Dir.gc 17 SHOW
changearg Dir.gc 21 4 <
changegad Dir.gc 0 -1 -1 440 229 ""
redraw Dir.gc
xRoutine CloseWindow ; make it small again
fm_mode = 1
setgad Dir.gc 2 HIDE
setgad Dir.gc 10 HIDE
setgad Dir.gc 11 HIDE
setgad Dir.gc 12 HIDE
setgad Dir.gc 13 HIDE
setgad Dir.gc 14 HIDE
setgad Dir.gc 15 HIDE
setgad Dir.gc 151 HIDE
setgad Dir.gc 16 HIDE
setgad Dir.gc 17 HIDE
changegad Dir.gc 0 -1 -1 220 229 ""
changearg Dir.gc 21 4 >
redraw Dir.gc